﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTOS.Products;
namespace BLL.Concrete.Products
{
    public class StonesBAL
    {

        public bool Create(IList<StonesDTO> objStones)
        {
            bool result = false;
            try
            {
                if (objStones.Count > 0)
                {

                    result = new DBLayer.Products().CreateStonesDtls(objStones);

                    if (!result)
                    {
                        throw new Exception("Error while inserting stone details");
                    }
                }
                else {
                    throw new Exception("No stone Details found");
                
                }

                return result;
            }

            catch { throw; }


        }

        public bool Update(StonesDTO objStones)
        {
            bool result = false;
            try
            {

                result = new DBLayer.Products().UpdateStoneDtls(objStones);

                if (!result)
                {
                    throw new Exception("Error while updating product");
                }


                return result;
            }

            catch { throw; }

        }

       

    }
}
